<%= header %>
<!--
This artificially sends a XHR beacon at the exact moment a SPA Soft navigation beacon is
just about to be sent (by triggering a BOOMR.responseEnd() in before_beacon).
-->
<%= boomerangScript %>
<base href="/pages/05-angular/123-alwayssendxhr-merging.html" />
<script src="../../vendor/angular/angular.js"></script>
<script src="../../vendor/angular-resource/angular-resource.js"></script>
<script src="../../vendor/angular-route/angular-route.js"></script>
<script src="support/app.js"></script>
<div ng-app="app">
	<div ng-view>
	</div>
</div>
<script src="123-alwayssendxhr-merging.js" type="text/javascript"></script>
<script>
window.angular_html5_mode = true;

window.angular_nav_routes = ["/widgets/1", "123-alwayssendxhr-merging.html"];

BOOMR_test.init({
	testAfterOnBeacon: BOOMR.plugins.AutoXHR ? 5 : 1,
	Angular: {
		enabled: true
	},
	instrument_xhr: true,
	autorun: false
});

BOOMR.subscribe("before_beacon", function(beacon) {
	// send XHRs when the SPA beacon is in process
	if (beacon["http.initiator"] === "spa") {
		var now = BOOMR.now();

		BOOMR.responseEnd({
			initiator: "xhr",
			url: "http://bad.com",
			timing: {
				requestStart: now - 100,
				loadEventEnd: now,
				responseEnd: now
			}
		});
	}
});

</script>
<%= footer %>
